<template>
  <div id="app">
    <a-header :mage='seller' v-if="flag"></a-header>
    <a-navs></a-navs>
    <!--<a-goods :seller='seller'></a-goods>-->
    <router-view :seller='seller' />
  </div>
</template>
<script>
import header from "@/components/header";
import navs from "@/components/navs.vue";
import goods from "@/components/goods.vue";
const ERRNO = 0;
export default {
  name: "app",
  components: {
    "a-navs": navs,
    "a-header": header,
    "a-goods": goods
  },
  data() {
    return {
      seller: {},
      flag: false
    };
  },
  mounted() {
    axios
      .get("./api/data.json")
      .then(re => {
        if (re.data.errno === ERRNO) {
          this.seller = re.data.seller;
          this.flag = true;
        }
      })
      .catch(err => {
        console.log(222);
      });
  }
};
</script>
<style lang="stylus">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
